package it.nard.utils;

import java.text.ParseException;
import java.text.SimpleDateFormat;

import it.nard.controller.BasicController;

public class TimeSlots {

	
	public Integer startDate;
	public Integer endDate;
	
	
	
	public String getLabelString(){
		String out = "";
		if(endDate==startDate +1){
			SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
			try {
				out = sdf.format(BasicController.SDF_4_DB.parse(startDate.toString()));
			} catch (ParseException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		else{
			SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
			try {
				out = sdf.format(BasicController.SDF_4_DB.parse(startDate.toString()));
			} catch (ParseException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			
			try {
				out =out.concat(" - " +sdf.format(BasicController.SDF_4_DB.parse(new Integer(endDate-1).toString())));
			} catch (ParseException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		return out;
	}
}
